package com.zcily.demo.controller;

import com.zcily.demo.entity.dto.Result;
import com.zcily.demo.entity.po.Org;
import com.zcily.demo.service.OrgService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * <p>
 * 组织机构表 前端控制器
 * </p>
 *
 * @author CGG
 * @since 2025-03-16
 */
@Controller
@RequestMapping("/org")
@Api(tags = "机构信息")
public class OrgController {

    @Autowired
    private OrgService orgService;

    @GetMapping("/detail")
    @ResponseBody
    @ApiOperation(value = "机构详情")
    public Result<Org> detail(@RequestParam("id") Integer orgId) {
        Org org = orgService.getById(orgId);
        return Result.ok(org);
    }
}
